package com.phenix.network.response

sealed class NetworkResponse<out T : Any>(
    open val data: T? = null,
    open val code: Int? = null,
    open val msg: String? = null,
    open val error: Throwable? = null
) {
    data class Success<T : Any>(val body: T) : NetworkResponse<T>(data = body)
    data class ApiError(override val msg: String?, override val code: Int) :
        NetworkResponse<Nothing>(msg = msg, code = code)

    data class NetworkError(override val msg: String?, override val code: Int) :
        NetworkResponse<Nothing>(msg = msg, code = code)

    data class UnknownError(override val error: Throwable?) : NetworkResponse<Nothing>(error = error)
}
